package com.ts.api.module.match.market.internal.wrapper;

import com.ts.api.module.api.entity.ApiUserRequest;
import com.ts.api.module.channel.entity.po.ChannelUserRegisterPO;
import com.ts.api.module.match.market.internal.wrapper.model.MarketDataExchange;
import org.springframework.stereotype.Component;

/**
 *  手机号md5包装器
 *
 *  @author Pan
 */
@Component
public class MarketDataExchangeMd5Wrapper implements MarketDataExchangeWrapper {

    @Override
    public ApiUserRequest wrap(MarketDataExchange marketDataExchange) {
        ChannelUserRegisterPO channelUserRegisterPO = marketDataExchange.getChannelUserRegisterPO();

        ApiUserRequest apiUserRequest = new ApiUserRequest();
        apiUserRequest.setIp(marketDataExchange.getIp());
        apiUserRequest.setPhoneMd5(channelUserRegisterPO.getPhoneMd5());
        return apiUserRequest;
    }
}
